/*!
 * TouchSlide v1.1
 * javascript触屏滑动特效插件，移动端滑动特效，触屏焦点图，触屏Tab切换，触屏多图切换等
 * 详尽信息请看官网：http://www.SuperSlide2.com/TouchSlide/
 *
 * Copyright 2013 大话主席
 *
 * 请尊重原创，保留头部版权
 * 在保留版权的前提下可应用于个人或商业用途

 * 1.1 宽度自适应（修复安卓横屏时滑动范围不变的bug）
 */
//jq提交验证
//登录部分
function loginDo(){
    var mobile=$('#mobile').val();
    var pwd=$('#input_password').val();
    var verify=$('#input_verify').val();
    var url=$('#lgform').data("lgurl");

    if(verify =='' || verify ==='验证码'){
        layer.tips('请输入验证码！', $('#input_verify'), {
            style: ['background-color:#0FA6D8; color:#fff','#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(mobile =='' || mobile ==='请输入手机号码'){
        layer.tips('账号不能为空！', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff','#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	/*if(/^1\d{10}$/g.test(name)===false){
        layer.tips('请输入正确的手机号码！', $('#user'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }*/
    if(pwd =='' || pwd ==='请输入密码'){
        layer.tips('密码不能为空！', $('#input_password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(pwd.length < 6 ||pwd.length>16){
        layer.tips('请输入正确的密码！', $('#input_password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url, {
            Action: "post",
            mobile:mobile,
            password:pwd,
            verify:verify
        },
        function (data,textStatus){
            layer.close(loginload);
            if(1==data.flag){
                layer.load(data.msg);
                setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
            }else{
                layer.msg(data.msg);
            }
        }, "json");
}

//注册验证
function registerDo(){
    var mobile      = $("#mobile").val();
    var username     = $('#username').val();
    var password    = $('#password').val();
    var re_password = $('#re_password').val();
    var verify      = $('#input_verify').val();
    var url         = $("#reform").data("url");

    if(verify =='' || verify =='验证码'){
        layer.tips('验证码不能为空！', $('#input_verify'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(mobile =='' || mobile =='请输入手机号码'){
        layer.tips('手机号不能为空！', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码！', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(username =='' || username =='请输入您的姓名'){
        layer.tips('姓名不能为空！', $('#username'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(password =='' || password =='请输入6~16位密码，包含数字、字母'){
        layer.tips('密码不能为空！', $('#password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(password.length < 6 || password.length>16){
        layer.tips('请按要求输入！', $('#password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(password != re_password){
        layer.tips('两次输入密码不一致！', $('#re_password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
            Action: "post",
            verify: verify,
            mobile:mobile,
            user_nicename:username,
            password:password,
            re_password:re_password
        },function (data,textStatus){
            layer.close(loginload);
            if(1==data.flag){
                layer.load(data.msg);
                setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
            }else{
                layer.msg(data.msg);
            }
        }, "json");
}
//修改密码
function passDo(){
    var or_pass = $('#or_pass').val();
    var password = $('#password').val();
    var re_pass = $('#re_pass').val();
    var url    = $("#paform").data("paurl");

    if(or_pass =='' || or_pass =='请输入原始密码'){
        layer.tips('原始密码不能为空！', $('#or_pass'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:150
        });
        return;
    }
    if(password =='' || password =='请输入6~16位密码，包含数字或字母'){
        layer.tips('密码不能为空！', $('#password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(password.length < 6 || password.length>16){
        layer.tips('请按要求输入！', $('#password'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(password != re_pass){
        layer.tips('两次输入密码不一致！', $('#re_pass'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
            Action: "post",
            or_pass:or_pass,
            password:password,
            re_pass:re_pass
        },
        function (data,textStatus){
            layer.close(loginload);
            if(1==data.flag){
                //alert(data.url);
                layer.load(data.msg);
                setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
            }else{
                layer.msg(data.msg);
            }
        }, "json");
}
//意见反馈提交验证
function messageDo(){
    var name     = $('#name').val();
    var email    = $('#email').val();
    var mobile      = $("#mobile").val();
    var address  = $('#address').val();
    var type  = $('#type').val();
    var content  = $('#content').val();
    var verify      = $('#input_verify').val();
    var url         = $("#mesform").data("mesurl");
    alert(url);
    /*if(verify =='' || verify =='验证码'){
        layer.tips('验证码不能为空！', $('#input_verify'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(name =='' || name =='请输入姓名'){
        layer.tips('姓名不能为空！', $('#name'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(email != '' && email != '请输入邮箱地址'){
        if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)){
            layer.tips('请输入正确的邮箱地址！', $('#email'), {
                style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
                maxWidth:200
            });
            return;
        }
    }
    if(mobile =='' || mobile =='请输入手机号码'){
        layer.tips('手机号不能为空！', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(address =='' || address =='请输入联系地址'){
        layer.tips('联系地址不能为空！', $('#address'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(content =='' || content =='请输入不超过300字的留言内容'){
        layer.tips('请输入不超过300字的留言内容！', $('#content'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(content.length > 300){
        layer.tips('请按要求输入！', $('#content'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }*/
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
        Action: "post",
        verify: verify,
        full_name:name,
        email:email,
        mobile:mobile,
        address:address,
        type:type,
        msg:content
    },function (data,textStatus){
        layer.close(loginload);
        if(1==data.flag){
            layer.load(data.msg);
            setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
        }else{
            layer.msg(data.msg);
        }
    }, "json");
}
//资料需求报名
function studentMobileDo(){
    var name     = $('#guestname5').val();
    var xuqiu    = $('#guestneed5').val();
    var mobile   = $("#telInput5").val();
    var url       = $("#mesform").data("mesurl");
     
    if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#guestname5'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    /*if(email != '' && email != '请输入邮箱地址'){
        if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)){
            layer.tips('请输入正确的邮箱地址！', $('#email'), {
                style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
                maxWidth:200
            });
            return;
        }
    }*/
    if(mobile =='' || mobile =='您的手机号码'){
        layer.tips('手机号码不能为空！', $('#telInput5'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#telInput5'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
        Action: "post",
        name:name,
        mobile:mobile,
        xuqiu:xuqiu
    },function (data,textStatus){
        layer.close(loginload);
        if(1==data.flag){
            layer.load(data.msg);
            setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
        }else{
            layer.msg(data.msg);
        }
    }, "json");
}

//成考资料获取
function studentMobileDo_04(){
    var name     = $('#guestname4').val();
    var mobile   = $("#telInput4").val();
    var url       = $("#mesform4").data("mesurl");
    
    if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#guestname4'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    /*if(email != '' && email != '请输入邮箱地址'){
        if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)){
            layer.tips('请输入正确的邮箱地址！', $('#email'), {
                style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
                maxWidth:200
            });
            return;
        }
    }*/
    if(mobile =='' || mobile =='您的手机号码'){
        layer.tips('手机号码不能为空！', $('#telInput4'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#telInput4'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
        Action: "post",
        name:name,
        mobile:mobile
    },function (data,textStatus){
        layer.close(loginload);
        if(1==data.flag){
            layer.load(data.msg);
            setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
        }else{
            layer.msg(data.msg);
        }
    }, "json");
}
//底部提交申请
function studentMobileDo_06(){
    var name     = $('#guestname6').val();
    var mobile   = $("#telInput6").val();
    var url       = $("#mesform6").data("mesurl");
    
    if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#guestname6'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    /*if(email != '' && email != '请输入邮箱地址'){
        if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)){
            layer.tips('请输入正确的邮箱地址！', $('#email'), {
                style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
                maxWidth:200
            });
            return;
        }
    }*/
    if(mobile =='' || mobile =='您的手机号码'){
        layer.tips('手机号码不能为空！', $('#telInput6'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#telInput6'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
        Action: "post",
        name:name,
        mobile:mobile
    },function (data,textStatus){
        layer.close(loginload);
        if(1==data.flag){
            layer.load(data.msg);
            setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
        }else{
            layer.msg(data.msg);
        }
    }, "json");
}



//在线报名
function sign_Up1(id){
    var name     = $('#name').val();
	var sex     = $('#sex').val();
    var ID_card    = $('#ID_card').val();
	var mobile     = $('#mobile').val();
	 var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
	 if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#name'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	 if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }

	 if(ID_card =='' || ID_card =='您的身份证号码'){
        layer.tips('身份证号码不能为空！', $('#ID_card'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200		
        });
        return;
    }
  if(reg.test(ID_card) === false){ 
       layer.tips('身份证号不合法！', $('#ID_card'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
   }  
	
	
	
	var beforeid = Number(id)+1;			
	$("#information"+id).hide();
	$("#information"+beforeid).show();
	$(".xubox_layer").remove();
}

//在线报名
function sign_Up(){
    var name     = $('#name').val();
	var sex     = $('#sex').val();
    var ID_card    = $('#ID_card').val();
    var nation      = $("#nation").val();
    var education  = $('#education').val();
	var graduation     = $('#graduation').val();
    var graduation_time    = $('#graduation_time').val();
    var arrangement  = $('#arrangement').val();
    var major  = $('#major').val();
	var zy1  = $('#zhuanye1').val();
	var mobile     = $('#mobile').val();
    var address    = $('#address').val();
    var qq  = $('#qq').val();
	var R_school  = $('#R_school').val();
    var urgent_tel  = $('#urgent_tel').val();
    var url       = $("#mesform").data("mesurl");
    if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#name'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }

	 if(name =='' || name =='您的姓名'){
        layer.tips('姓名不能为空！', $('#name'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	 if(sex =='' || sex =='您的性别'){
        layer.tips('性别不能为空！', $('#sex'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	 if(ID_card =='' || ID_card =='您的身份证号码'){
        layer.tips('身份证号码不能为空！', $('#ID_card'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	 if(education =='' || education =='您的当前'){
        layer.tips('当前学历不能为空！', $('#education'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
    if(/^1\d{10}$/g.test(mobile)===false){
        layer.tips('请输入正确的手机号码', $('#mobile'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }
	 if(qq ==''){
        layer.tips('请输入您的QQ号码！', $('#qq'), {
            style: ['background-color:#0FA6D8; color:#fff', '#0FA6D8'],
            maxWidth:200
        });
        return;
    }    
    var loginload = layer.load(5,0); //需关闭加载层时，执行即可
    $.post(url,{
        Action: "post",
        name:name,
        sex:sex,
		ID_card:ID_card,
		nation:nation,
		education:education,
		graduation:graduation,
		graduation_time:graduation_time,
		arrangement:arrangement,
		major:major,
		zy1:zy1,
		mobile:mobile,
		R_school:R_school,
		address:address,
		urgent_tel:urgent_tel,
        qq:qq
    },function (data,textStatus){
        layer.close(loginload);
        if(1==data.flag){
            layer.load(data.msg);
			setTimeout("javascript:location.href='"+data.url+"';",1000);//1秒钟后跳转
        }else{
            layer.msg(data.msg);
			//$(".bodys").show();
			//$(".mains").show();
        }
    }, "json");
}